string Preprocess(ForeignItem f, string code) { switch (f.SourceKind) { case ForeignItem.Kind.ObjCHeader: case ForeignItem.Kind.ObjCSource: return(new ForeignObjCPass(Backend).Preprocess(new Source(f.UnixPath), code)); case ForeignItem.Kind.Java: default: return(code); } }
SourceValue?GetRequiredDestination(ForeignItem fsource, Source projectSource) { if (fsource.SourceKind != ForeignItem.Kind.Java) { return(null); } var fullJavaSourcePath = fsource.UnixPath.UnixToNative() .ToFullPath(projectSource.Package.SourceDirectory); var packageName = GetJavaPackageName(fullJavaSourcePath); return(new SourceValue(projectSource, Environment.GetString("Java.SourceDirectory") + "/" + packageName.Replace('.', '/') + Path.GetFileName(fsource.UnixPath))); }
/// <summary> /// The handle event item subscribed. /// </summary> /// <param name="game"> /// The mmo game. /// </param> /// <param name="eventData"> /// The event data. /// </param> private static void HandleEventItemSubscribed(Game game, IDictionary eventData) { var itemType = (byte)eventData[(byte)ParameterCode.ItemType]; var itemId = (string)eventData[(byte)ParameterCode.ItemId]; var position = (float[])eventData[(byte)ParameterCode.Position]; var cameraId = (byte)eventData[(byte)ParameterCode.InterestAreaId]; float[] rotation = eventData.Contains((byte)ParameterCode.Rotation) ? (float[])eventData[(byte)ParameterCode.Rotation] : null; Item item; if (game.TryGetItem(itemType, itemId, out item)) { if (item.IsMine) { item.AddSubscribedInterestArea(cameraId); item.AddVisibleInterestArea(cameraId); } else { var revision = (int)eventData[(byte)ParameterCode.PropertiesRevision]; if (revision == item.PropertyRevision) { item.AddSubscribedInterestArea(cameraId); item.AddVisibleInterestArea(cameraId); } else { item.AddSubscribedInterestArea(cameraId); item.GetProperties(); } item.SetPositions(position, position, rotation, rotation); } } else { item = new ForeignItem(itemId, itemType, game); item.SetPositions(position, position, rotation, rotation); game.AddItem(item); item.AddSubscribedInterestArea(cameraId); item.GetProperties(); } }